class RecommendProductsModel {
  String type;
  String code;
  String message;
  List<RecommendProduct> list;
  String productDataFrom;

  RecommendProductsModel(
      {this.type, this.code, this.message, this.list, this.productDataFrom});

  RecommendProductsModel.fromJson(Map<String, dynamic> json) {
    type = json['type'];
    code = json['code'];
    message = json['message'];
    if (json['list'] != null) {
      list = new List<RecommendProduct>();
      json['list'].forEach((v) {
        list.add(new RecommendProduct.fromJson(v));
      });
    }
    productDataFrom = json['productDataFrom'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['type'] = this.type;
    data['code'] = this.code;
    data['message'] = this.message;
    if (this.list != null) {
      data['list'] = this.list.map((v) => v.toJson()).toList();
    }
    data['productDataFrom'] = this.productDataFrom;
    return data;
  }
}

class RecommendProduct {
  String broadTax;
  bool canPurchase;
  String categoryName;
  String code;
  String commission;
  List<Description> description;
  bool discountedProduct;
  bool discountedQuotaProduct;
  String exactOnlinePate;
  String firstLevelCategoryCode;
  bool fromMicroBuyLabel;
  List<GalleryImages> galleryImages;
  double groupPrice;
  Images images;
  bool isAddCart;
  bool isAlmostOutOfStock;
  bool isAmplusGift;
  bool isExactOnline;
  bool isFavourite;
  bool isGift;
  bool isGoodListShow;
  bool isMixologisticsBase;
  bool isMixologisticsProuct;
  bool isOrderable;
  bool isVariantOptions;
  List<String> labelDescription;
  String microCategoryCode;
  String month;
  String name;
  Price price;
  String salesTerminology;
  String sopLable;
  Stock stock;
  String url;
  List<VariantOptions> variantOptions;
  String variantAttributeName;
  List<ProductTag> productTag;

  RecommendProduct(
      {this.broadTax,
      this.canPurchase,
      this.categoryName,
      this.code,
      this.commission,
      this.description,
      this.discountedProduct,
      this.discountedQuotaProduct,
      this.exactOnlinePate,
      this.firstLevelCategoryCode,
      this.fromMicroBuyLabel,
      this.galleryImages,
      this.groupPrice,
      this.images,
      this.isAddCart,
      this.isAlmostOutOfStock,
      this.isAmplusGift,
      this.isExactOnline,
      this.isFavourite,
      this.isGift,
      this.isGoodListShow,
      this.isMixologisticsBase,
      this.isMixologisticsProuct,
      this.isOrderable,
      this.isVariantOptions,
      this.labelDescription,
      this.microCategoryCode,
      this.month,
      this.name,
      this.price,
      this.salesTerminology,
      this.sopLable,
      this.stock,
      this.url,
      this.variantOptions,
      this.variantAttributeName,
      this.productTag});

  RecommendProduct.fromJson(Map<String, dynamic> json) {
    broadTax = json['broadTax'];
    canPurchase = json['canPurchase'];
    categoryName = json['categoryName'];
    code = json['code'];
    commission = json['commission'];
    if (json['description'] != null) {
      description = new List<Description>();
      json['description'].forEach((v) {
        description.add(new Description.fromJson(v));
      });
    }
    discountedProduct = json['discountedProduct'];
    discountedQuotaProduct = json['discountedQuotaProduct'];
    exactOnlinePate = json['exactOnlinePate'];
    firstLevelCategoryCode = json['firstLevelCategoryCode'];
    fromMicroBuyLabel = json['fromMicroBuyLabel'];
    if (json['galleryImages'] != null) {
      galleryImages = new List<GalleryImages>();
      json['galleryImages'].forEach((v) {
        galleryImages.add(new GalleryImages.fromJson(v));
      });
    }
    groupPrice = json['groupPrice'];
    images =
        json['images'] != null ? new Images.fromJson(json['images']) : null;
    isAddCart = json['isAddCart'];
    isAlmostOutOfStock = json['isAlmostOutOfStock'];
    isAmplusGift = json['isAmplusGift'];
    isExactOnline = json['isExactOnline'];
    isFavourite = json['isFavourite'];
    isGift = json['isGift'];
    isGoodListShow = json['isGoodListShow'];
    isMixologisticsBase = json['isMixologisticsBase'];
    isMixologisticsProuct = json['isMixologisticsProuct'];
    isOrderable = json['isOrderable'];
    isVariantOptions = json['isVariantOptions'];
    labelDescription = json['labelDescription']!=null?json['labelDescription'].cast<String>():null;
    microCategoryCode = json['microCategoryCode'];
    month = json['month'];
    name = json['name'];
    price = json['price'] != null ? new Price.fromJson(json['price']) : null;
    salesTerminology = json['salesTerminology'];
    sopLable = json['sopLable'];
    stock = json['stock'] != null ? new Stock.fromJson(json['stock']) : null;
    url = json['url'];
    if (json['variantOptions'] != null) {
      variantOptions = new List<VariantOptions>();
      json['variantOptions'].forEach((v) {
        variantOptions.add(new VariantOptions.fromJson(v));
      });
    }
    variantAttributeName = json['variantAttributeName'];
    if (json['productTag'] != null) {
      productTag = new List<ProductTag>();
      json['productTag'].forEach((v) {
        productTag.add(new ProductTag.fromJson(v));
      });
    }
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['broadTax'] = this.broadTax;
    data['canPurchase'] = this.canPurchase;
    data['categoryName'] = this.categoryName;
    data['code'] = this.code;
    data['commission'] = this.commission;
    if (this.description != null) {
      data['description'] = this.description.map((v) => v.toJson()).toList();
    }
    data['discountedProduct'] = this.discountedProduct;
    data['discountedQuotaProduct'] = this.discountedQuotaProduct;
    data['exactOnlinePate'] = this.exactOnlinePate;
    data['firstLevelCategoryCode'] = this.firstLevelCategoryCode;
    data['fromMicroBuyLabel'] = this.fromMicroBuyLabel;
    if (this.galleryImages != null) {
      data['galleryImages'] =
          this.galleryImages.map((v) => v.toJson()).toList();
    }
    data['groupPrice'] = this.groupPrice;
    if (this.images != null) {
      data['images'] = this.images.toJson();
    }
    data['isAddCart'] = this.isAddCart;
    data['isAlmostOutOfStock'] = this.isAlmostOutOfStock;
    data['isAmplusGift'] = this.isAmplusGift;
    data['isExactOnline'] = this.isExactOnline;
    data['isFavourite'] = this.isFavourite;
    data['isGift'] = this.isGift;
    data['isGoodListShow'] = this.isGoodListShow;
    data['isMixologisticsBase'] = this.isMixologisticsBase;
    data['isMixologisticsProuct'] = this.isMixologisticsProuct;
    data['isOrderable'] = this.isOrderable;
    data['isVariantOptions'] = this.isVariantOptions;
    data['labelDescription'] = this.labelDescription;
    data['microCategoryCode'] = this.microCategoryCode;
    data['month'] = this.month;
    data['name'] = this.name;
    if (this.price != null) {
      data['price'] = this.price.toJson();
    }
    data['salesTerminology'] = this.salesTerminology;
    data['sopLable'] = this.sopLable;
    if (this.stock != null) {
      data['stock'] = this.stock.toJson();
    }
    data['url'] = this.url;
    if (this.variantOptions != null) {
      data['variantOptions'] =
          this.variantOptions.map((v) => v.toJson()).toList();
    }
    data['variantAttributeName'] = this.variantAttributeName;
    if (this.productTag != null) {
      data['productTag'] = this.productTag.map((v) => v.toJson()).toList();
    }
    return data;
  }
}

class Description {
  String detailInfo;

  Description({this.detailInfo});

  Description.fromJson(Map<String, dynamic> json) {
    detailInfo = json['detailInfo'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['detailInfo'] = this.detailInfo;
    return data;
  }
}

class GalleryImages {
  String middelImg;
  String smallImg;
  String zoomImg;

  GalleryImages({this.middelImg, this.smallImg, this.zoomImg});

  GalleryImages.fromJson(Map<String, dynamic> json) {
    middelImg = json['middelImg'];
    smallImg = json['smallImg'];
    zoomImg = json['zoomImg'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['middelImg'] = this.middelImg;
    data['smallImg'] = this.smallImg;
    data['zoomImg'] = this.zoomImg;
    return data;
  }
}

class Images {
  String icon;
  String url;

  Images({this.icon, this.url});

  Images.fromJson(Map<String, dynamic> json) {
    icon = json['icon'];
    url = json['url'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['icon'] = this.icon;
    data['url'] = this.url;
    return data;
  }
}

class Price {
  AmwayValue amwayValue;
  int giftPoint;
  int maxQuantity;
  int minQuantity;
  String priceRange;
  String value;

  Price(
      {this.amwayValue,
      this.giftPoint,
      this.maxQuantity,
      this.minQuantity,
      this.priceRange,
      this.value});

  Price.fromJson(Map<String, dynamic> json) {
    amwayValue = json['amwayValue'] != null
        ? new AmwayValue.fromJson(json['amwayValue'])
        : null;
    giftPoint = json['giftPoint'];
    maxQuantity = json['maxQuantity'];
    minQuantity = json['minQuantity'];
    priceRange = json['priceRange'];
    value = json['value'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    if (this.amwayValue != null) {
      data['amwayValue'] = this.amwayValue.toJson();
    }
    data['giftPoint'] = this.giftPoint;
    data['maxQuantity'] = this.maxQuantity;
    data['minQuantity'] = this.minQuantity;
    data['priceRange'] = this.priceRange;
    data['value'] = this.value;
    return data;
  }
}

class AmwayValue {
  String businessVolume;
  String pointValue;

  AmwayValue({this.businessVolume, this.pointValue});

  AmwayValue.fromJson(Map<String, dynamic> json) {
    businessVolume = json['businessVolume'];
    pointValue = json['pointValue'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['businessVolume'] = this.businessVolume;
    data['pointValue'] = this.pointValue;
    return data;
  }
}

class Stock {
  int stockLevel;
  String stockLevelStatus;
  String stockLevelTip;

  Stock({this.stockLevel, this.stockLevelStatus, this.stockLevelTip});

  Stock.fromJson(Map<String, dynamic> json) {
    stockLevel = json['stockLevel'];
    stockLevelStatus = json['stockLevelStatus'];
    stockLevelTip = json['stockLevelTip'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['stockLevel'] = this.stockLevel;
    data['stockLevelStatus'] = this.stockLevelStatus;
    data['stockLevelTip'] = this.stockLevelTip;
    return data;
  }
}

class VariantOptions {
  String code;
  String exactOnlineDate;
  double groupPrice;
  Image image;
  bool isAlmostOutOfStock;
  bool isExactOnline;
  String name;
  Price price;
  Stock stock;
  String variantAttributeName;

  VariantOptions(
      {this.code,
      this.exactOnlineDate,
      this.groupPrice,
      this.image,
      this.isAlmostOutOfStock,
      this.isExactOnline,
      this.name,
      this.price,
      this.stock,
      this.variantAttributeName});

  VariantOptions.fromJson(Map<String, dynamic> json) {
    code = json['code'];
    exactOnlineDate = json['exactOnlineDate'];
    groupPrice = json['groupPrice'];
    image = json['image'] != null ? new Image.fromJson(json['image']) : null;
    isAlmostOutOfStock = json['isAlmostOutOfStock'];
    isExactOnline = json['isExactOnline'];
    name = json['name'];
    price = json['price'] != null ? new Price.fromJson(json['price']) : null;
    stock = json['stock'] != null ? new Stock.fromJson(json['stock']) : null;
    variantAttributeName = json['variantAttributeName'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['code'] = this.code;
    data['exactOnlineDate'] = this.exactOnlineDate;
    data['groupPrice'] = this.groupPrice;
    if (this.image != null) {
      data['image'] = this.image.toJson();
    }
    data['isAlmostOutOfStock'] = this.isAlmostOutOfStock;
    data['isExactOnline'] = this.isExactOnline;
    data['name'] = this.name;
    if (this.price != null) {
      data['price'] = this.price.toJson();
    }
    if (this.stock != null) {
      data['stock'] = this.stock.toJson();
    }
    data['variantAttributeName'] = this.variantAttributeName;
    return data;
  }
}

class Image {
  String url;

  Image({this.url});

  Image.fromJson(Map<String, dynamic> json) {
    url = json['url'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['url'] = this.url;
    return data;
  }
}

class ProductTag {
  String productTagImageURL;

  ProductTag({this.productTagImageURL});

  ProductTag.fromJson(Map<String, dynamic> json) {
    productTagImageURL = json['productTagImageURL'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['productTagImageURL'] = this.productTagImageURL;
    return data;
  }
}